﻿#ifndef DETECTIONANALYSIS_H
#define DETECTIONANALYSIS_H

#include <QWidget>
#include <QProxyStyle>
#include <QPainter>
#include <QStyleOptionTab>
#include "xlsxdocument.h"
#include <QDebug>
#include <dbHelper.h>
#include <QFileDialog>
#include <QItemDelegate>

namespace Ui {
class DetectionAnalysis;
}

class DetectionAnalysis : public QWidget
{
    Q_OBJECT

public:
    explicit DetectionAnalysis(QWidget *parent = nullptr);
    ~DetectionAnalysis();

signals:
    void changeToopenfileWindow();
    void changeTouploadfileWindow();
private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    void on_returnBtn_clicked();


    void on_SaveBtn_2_clicked();

    void on_SaveBtn_clicked();

private:
    void showEvent(QShowEvent *event) override;

private:
    Ui::DetectionAnalysis *ui;
    void tab1();
    void datain();
    QStringList bzend,fbzend,vaend;
    QList<int> bzed,fbzed;
    int q5fl;
    void datacu(int row, double famn, double vicn, double roxn, double cqv, double cqbz);
    void tab2();
    void dataca(int row, double ICS, double DI, double AL, double AS, double Y);
    bool YSTRfl=false;
    bool miniSTRfl=false;
    void xsui(int row, QString type, int tx);
    void tab2xh();
    int ynum;
    int tabifl=1;
};
//自定义tabbar的样式
class CustomTabStyle3:public QProxyStyle{
public:
    CustomTabStyle3(){}
    QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const;
    void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const;
};

#endif // DETECTIONANALYSIS_H
